package com.shd.edanpei.enums;

/**
 * Created by mc on 2018/9/5.
 * yang-wen-wen
 */

//性别
public enum GenderEnum {

    male(0, "男"), female(1, "女");

    Integer key;
    String value;

    GenderEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static Integer getKey(String gender) {
        return gender.equals(male.getValue()) ? male.getKey() : female.getKey();
    }

    public static String getGender(int key) {
        return key == male.getKey() ? male.getValue() : female.getValue();
    }
}